Skip to content

feat: make model generation budgets configurable - #37

Open
minixalpha wants to merge 5 commits into
mainfrom
feat/model-generation-budget
Open

feat: make model generation budgets configurable#37
minixalpha wants to merge 5 commits into
mainfrom
feat/model-generation-budget

Conversation

@minixalpha

@minixalpha minixalpha commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Replies previously used a fixed 8192-token generation cap. Add --max-tokens and ANTHROPIC_MAX_TOKENS with CLI > environment > user settings > default precedence, and raise the default to 32768. Interactive and headless runs use the resolved limit on every request; invalid effective values fail before a model call.

Harbor forwards explicit budgets and environment settings. Startup output, Event Journals, and ATIF record the effective cap separately from usage, while older journals still replay. Existing truncation handling is preserved. Bilingual user documentation and development notes cover configuration, first-party research into benchmark settings and agent defaults, and the complete experiment record.

Validation:

  • Core suite: 242 passed; Harbor adapter suite: 22 passed.
  • Configuration precedence, every-request forwarding, real SDK serialization, and truncation regressions pass.
  • Python 3.13 and 3.14 CI passed on final PR head 2b9166551275ae20e81edf7fd52d26b44344ea81.
  • All 32768 real-model runs preserve the previous task hashes, DeepSeek V4 Flash 0731 through OpenRouter, and 50 turns, using a source-verified wheel from 7a610cbf87ee3ac27f8cdb8a4329076f210dee8d without CLI/environment budget overrides. The initial runs retain native 900-second task deadlines; the separate diagnostic runs below extend the allowance and capture complete evidence.
Case 8192 baseline Initial 32768 results (09-09)
regex-log Reward 0, response_truncated Initial installation timeout before model execution; separate retry reached the 900-second task deadline, reward 0
write-compressor Reward 0, response_truncated Initial server-side stream interruption, reward 0; one separate retry reached the 900-second task deadline, reward 0

Both retries extend only the installation window from 360 to 1080 seconds. All initial failures are retained. There were three model-executing, scored runs, all reward 0, plus one installation failure. Neither timed-out retry produced final ATIF, leaving token totals, final stop reasons, and costs unknown. The interrupted compressor run has only a known first-reply cost subtotal.

On 09-10, a separate diagnostic regex-log run increased agent execution allowance to 3600 seconds and persisted an unshortened Journal, complete decoded response streams, chunk timing, and stack snapshots. Harbor received an outer 3780-second allowance for finalization; installation remained at 1080 seconds. The task passed (reward 1.0, official verifier 1 passed) in 580.4 seconds of agent execution, within the original 900-second deadline.

The first reply took 502.4 seconds, with sustained thinking output and a longest nonempty-delta gap of 3.4 seconds. All five replies completed without truncation; six tools took 0.023 seconds total. Complete usage is 74650 prompt tokens (including 53504 cached), 17264 completion tokens, and $0.005338074. Native ATIF validates and exactly matches all 147 untruncated Journal entries. The passive diagnostic wrapper passed normal, stalled, and forcibly terminated offline scenarios; it is retained with the local experiment scripts, without production instrumentation changes.

This run identifies sustained model thinking as its main delay, but does not reproduce or determine the exact cause of the historical timeout. It did not use the extra deadline allowance, so its success cannot be attributed to extending that deadline. Previous container dependency versions were not recorded; identical agent wheels do not establish identical runtime or backend conditions. All prior failures remain intact.

On 09-11, write-compressor repeated the same diagnostic method, retaining the wheel and byte-identical recorder. It failed (reward 0, three official tests failed because data.comp was absent) after 1449.1 seconds of agent execution. Its second reply took 1414.2 seconds and ended with max_tokens: 32768 output tokens, including 32767 provider-reported thinking tokens, with no visible text or tool arguments. Two local tools took only 0.004 seconds. At a read-only checkpoint at 900.4 seconds, the file was already confirmed absent while the second reply continued streaming; the longest generation-delta gap was 2.2 seconds.

The native outcome is response_truncated, without a deadline event or forced kill. All 13 Journal entries are unshortened, including 116281 thinking characters; native ATIF validates and exactly matches the Journal. Complete usage is 3926 prompt tokens, zero cached tokens, 32886 completion tokens, and $0.00615504. Both generation costs were resolved. This run directly demonstrates sustained thinking outlasting the original deadline and then exhausting the generation budget without delivering the file. Extending the deadline alone did not solve it; this does not retroactively establish the cause of the earlier untraced timeout or server interruption. The new container installed Anthropic SDK 1.5.0, versus 1.4.0 in the regex diagnostic, so resolved dependencies are explicitly recorded as another comparison limit.

32768 remains the requested experimental default. The successful regex diagnostic and failed compressor diagnostic do not establish benchmark-wide improvement. See the development notes for timings, accounting limits, source identity, and local artifact locations. Full diagnostic artifacts remain under Git-ignored jobs/ and have not been uploaded.

English user documentation and development notes are synchronized with the Chinese sources. No research-note source files under docs/research/ changed.

@minixalpha
minixalpha marked this pull request as ready for review September 10, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant